const Subscription = require('egg').Subscription;

class UpdateCache extends Subscription {

  static get schedule() {
    return {
      interval: '30s',
      type: 'all',
      immediate: true,
      disable: true,
    };
  }

  async subscribe() {
    this.logger.info('定时任务开始执行');
    this.ctx.app.cache = '123';
    this.logger.info('定时任务结束执行');
  }

}

module.exports = UpdateCache;